package a.f.l.a;

import a.c.d;
import a.f.ad;
import a.f.tb;

import java.util.*;

class ub
  extends sb
{
  private static final boolean f = true;
  private static final boolean g = false;
  private int h;
  private d i;
  private byte j;
  private boolean k;
  private mb l;
  
  protected void b(rb paramrb)
  {
    boolean bool = sb.e;
    super.b(paramrb);
    this.i = b().d();
    this.j = a().c().a(this.i).e();
    this.h = b().e().f().m();
    if (((bool) || (this.h > 0)) && ((bool) || (this.j != 0))) {
      if (bool) {}
    }
    this.k = (!this.i.g());
    this.l = paramrb.i();
  }
  
  protected double a(h paramh, mb parammb, jb paramjb, m paramm, double paramDouble)
  {
    boolean bool = sb.e;
    int i3 = sb.d;
    int m = paramh.j() == null ? 1 : 0;
    int n = paramm.e();
    if (!bool) {
      if (n != 4) {
        if (bool) {
          break label54;
        }
      }
    }
    label54:
    int i1 = n == 2 ? 1 : 0;
    double d = 0.0D;
    if ((bool) || (m == 0))
    {
      if (bool) {
        break label175;
      }
      if (i1 == 0) {}
    }
    else
    {
      arrayOftb = paramm.d();
      if (!bool) {}
      int i2 = m != 0 ? 0 : 1;
      if (bool) {
        break label270;
      }
      if (!a(arrayOftb, i2)) {
        break label269;
      }
      if (!bool)
      {
        if (d(paramh))
        {
          if (bool) {
            break label270;
          }
          if (!a(true)) {
            break label269;
          }
        }
        d = this.h;
        if (bool) {
          break label278;
        }
      }
      if (i3 == 0) {
        break label269;
      }
    }
    if (!bool) {
      label175:
      if (paramm.e() == 3) {
        if (!bool)
        {
          if (paramjb.e(paramh.c()))
          {
            d += this.h;
            if (bool) {
              break label278;
            }
          }
        }
        else {
          if (i3 == 0) {
            break label269;
          }
        }
      }
    }
    tb[] arrayOftb = paramm.d();
    if (!bool) {
      if (a(arrayOftb, 1))
      {
        if (!bool) {
          if (d(paramh))
          {
            if (bool) {
              break label270;
            }
            if (!a(true)) {
              break label269;
            }
          }
        }
        d = this.h;
      }
    }
    label269:
    label270:
    a("monotonic edge route penalty", d, false);
    label278:
    return d;
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    if (!sb.e) {
      if (!this.k)
      {
        b("monotonic edge route penalty", 0.0D, false);
        return new double[paramArrayOfjb.length];
      }
    }
    return super.a(paramh, parammb, paramArrayOfjb, paramArrayOfm, paramArrayOfDouble);
  }
  
  protected double b(h paramh)
  {
    boolean bool = sb.e;
    if (!this.k) {
      return 0.0D;
    }
    double d = 0.0D;
    if (!bool)
    {
      if (a(paramh, this.l))
      {
        tb localtb = paramh.d().c();
        if (bool) {
          break label75;
        }
        if (a(localtb))
        {
          if (bool) {
            break label75;
          }
          if (a(false)) {
            d = this.h;
          }
        }
      }
      label75:
      a("HEUR monotonic penalty", d, true);
    }
    return d;
  }
  
  private boolean a(tb paramtb)
  {
    boolean bool = sb.e;
    a.f.o localo = a().a();
    if (!bool) {
      if (this.j != 2)
      {
        if (bool) {
          break label71;
        }
        if (this.j != 3) {
          break label61;
        }
      }
    }
    if (!bool)
    {
      localtb = a(this.i, localo, (byte)2);
      if (paramtb == localtb) {
        return true;
      }
    }
    label61:
    if (!bool) {
      if (this.j != 1)
      {
        label71:
        if (bool) {
          break label105;
        }
        if (this.j != 3) {
          break label104;
        }
      }
    }
    tb localtb = a(this.i, localo, (byte)1);
    if (paramtb == localtb) {
      return true;
    }
    label104:
    label105:
    return false;
  }
  
  private static boolean a(h paramh, mb parammb)
  {
    boolean bool = sb.e;
    tb localtb = paramh.d();
    mb localmb = paramh.a();
    if (!bool) {
      if (localtb == tb.b)
      {
        if (!bool) {}
        return parammb.k() <= localmb.i();
      }
    }
    if (!bool) {
      if (localtb == tb.d)
      {
        if (!bool) {}
        return localmb.k() <= parammb.i();
      }
    }
    if (localtb == tb.a)
    {
      if (!bool) {}
      return localmb.l() <= parammb.j();
    }
    if (!bool) {}
    return parammb.l() <= localmb.j();
  }
  
  private boolean a(boolean paramBoolean)
  {
    boolean bool = sb.e;
    int m = sb.d;
    r localr = a().a(this.i);
    List localList = localr.c(paramBoolean);
    if (((!bool) && (localList == null)) || ((bool) || (localList.isEmpty()))) {
      return true;
    }
    HashSet localHashSet = new HashSet();
    Object localObject = localList.iterator();
    if (((Iterator)localObject).hasNext()) {}
    while (bool)
    {
      ad localad = (ad)((Iterator)localObject).next();
      byte b = localad.e().b();
      if (!bool)
      {
        if (b == 0) {
          return true;
        }
        localHashSet.add(a(b));
      }
      if (m == 0) {
        break;
      }
    }
    localObject = d();
    ((Set)localObject).retainAll(localHashSet);
    if (!bool) {}
    return !((Set)localObject).isEmpty();
  }
  
  private static tb a(byte paramByte)
  {
    switch (paramByte)
    {
    case 1: 
      return tb.a;
    case 2: 
      return tb.c;
    case 4: 
      return tb.d;
    case 8: 
      return tb.b;
    }
    throw new IllegalArgumentException(paramByte + "not allowed");
  }
  
  private static boolean d(h paramh)
  {
    if (!sb.e) {}
    return !paramh.i();
  }
  
  private Set d()
  {
    boolean bool = sb.e;
    a.f.o localo = a().a();
    HashSet localHashSet = new HashSet(Arrays.asList(new tb[] { tb.a, tb.c, tb.d, tb.b }));
    if (!bool) {
      if (this.j != 2)
      {
        if (bool) {
          break label106;
        }
        if (this.j != 3) {
          break label96;
        }
      }
    }
    tb localtb = a(this.i, localo, (byte)2);
    localHashSet.remove(localtb);
    label96:
    if (!bool) {
      if (this.j != 1) {
        label106:
        if ((!bool) && (this.j != 3)) {
          return localHashSet;
        }
      }
    }
    localtb = a(this.i, localo, (byte)1);
    localHashSet.remove(localtb);
    return localHashSet;
  }
  
  private boolean a(tb[] paramArrayOftb, int paramInt)
  {
    boolean bool = sb.e;
    int n = sb.d;
    a.f.o localo = a().a();
    if (!bool) {
      if (this.j != 2)
      {
        if (bool) {
          break label103;
        }
        if (this.j != 3) {
          break label97;
        }
      }
    }
    tb localtb = a(this.i, localo, (byte)2);
    int m = paramInt;
    do
    {
      if (m >= paramArrayOftb.length) {
        break;
      }
      if (bool) {
        break label107;
      }
      if (n != 0) {
        break label106;
      }
      if (localtb.equals(paramArrayOftb[m])) {
        return true;
      }
      m++;
    } while (n == 0);
    label97:
    if (!bool)
    {
      label103:
      label106:
      label107:
      if ((!bool) && ((this.j != 1) && ((!bool) && (this.j != 3)))) {}
    }
    else
    {
      localtb = a(this.i, localo, (byte)1);
      m = paramInt;
      do
      {
        if (m >= paramArrayOftb.length) {
          break;
        }
        if (n != 0) {
          break label177;
        }
        if (localtb.equals(paramArrayOftb[m])) {
          return true;
        }
        m++;
      } while (n == 0);
    }
    label177:
    return false;
  }
  
  private static tb a(d paramd, a.f.o paramo, byte paramByte)
  {
    boolean bool = sb.e;
    if (!bool) {
      if (paramByte == 2) {
        return paramo.m(paramd.e()) < paramo.m(paramd.f()) ? tb.d : tb.b;
      }
    }
    if ((bool) || (paramByte == 1)) {
      return paramo.n(paramd.e()) < paramo.n(paramd.f()) ? tb.a : tb.c;
    }
    return null;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.ub

 * JD-Core Version:    0.7.0.1

 */